<?php 
include TMPL_PATH.'public/header.phtml';
?>
<style>
.shopping-cart {
	background: url(/web/Tpl/default/images/cart/shopping-cart.png) no-repeat;
	background-size: 16px 14px;
}
.shopping-cart strong{
	padding-left: 20px;
}
</style>
<div class="subnav">
    <div class="content-menu ib-a blue line-x">
    	<div style="float:left;margin-right:50px;">
        <a href='javascript:;' class="on"><em>会员列表</em></a><span>|</span>
        <a href='<?php echo U('user/user_add');?>' ><em>添加会员</em></a>
      </div>
    	<div style="color:#000;">
    	<?php 
    		$designer_id = isset($search)&& isset($search['designer_id']) ? $search['designer_id'] : -1;
    		$rank_id = isset($search)&& isset($search['rank_id']) ? $search['rank_id'] : 0;
    	?>
    		<form name="searchform" action="__SELF__"  method="post">
    		会员等级 ：<select name="rank_id">
					<option value="0">≡ 全部  ≡</option>
					<?php 
						if(isset($rankList) && $rankList):
							foreach ($rankList as $rank):
					?>
					<option value="<?php echo $rank['id'];?>" <?php if($rank['id']==$rank_id)echo'selected';?>><?php echo $rank['name'];?></option>
				<?php 
						endforeach;
					endif;
				?>
				</select>&nbsp;&nbsp;&nbsp;设计师：<select name="is_designer">
				 	<option value='-1'>全部</option>
				 	<option value='1' <?php if($designer_id==1)echo 'selected';?>>是</option>
				 	<option value='0' <?php if($designer_id==0)echo 'selected';?>>否</option>
				 </select>&nbsp;&nbsp;&nbsp;
				 <?php 
				 $searchtype = isset($search)&& $search['searchtype'] ? $search['searchtype'] : 0;
				 $searchkeyword = isset($search)&& $search['keyword'] ? $search['keyword'] : null;
				 ?>
    		<select name="searchtype">
					<option value="0" <?php if($searchtype==0)echo 'selected';?> >邮件地址</option>
					<option value="1" <?php if($searchtype==1)echo 'selected';?> >会员名</option>
				</select>
				<input type="text" class="input-text" value="<?php echo $searchkeyword;?>" name="keyword">
				<input type="submit" value="搜索" class="button" name="search">&nbsp;&nbsp;&nbsp;&nbsp;
				<a href="<?php echo U('user/user_list_export');?>">导出会员信息</a>
    		</form>
    	</div>
    </div>
</div>
<div class="pad_10">
<div class="table-list">
    <table width="100%" cellspacing="0" >
        <thead>
            <tr>
            <th align='left'>用户名</th>
            <th align='left'>姓名</th>
<!--            <th align='center' width="100">会员等级</th>-->
            <th align='center' width="150">Email</th>
            <th align='center' width="100">可用资金</th>
<!--            <th align='center' width="100">冻结资金</th>
            <th align='center' width="100">等级积分</th>
            <th align='center' width="100">消费积分</th>-->
             <th align='center' width="50">状态</th>
             <th align='center' width="50">设计师</th>
            <th align='center' width="150">注册日期</th>
            <th align='center' width="150">语言</th>
						<th >管理操作</th>
            </tr>
        </thead>
     <tbody>
   <?php 
   	if(isset($userList) && $userList):
   		foreach ($userList as $v):
   ?>
			<tr>
					<td align='left'><?php echo $v['username'];?></td>
					<td align='left'><?php echo $v['nickname'] ? $v['nickname'] : ($v['first_name'].' '.$v['last_name']);?></td>
					<!--<td align='center'><?php echo $v['rank_name'];?></td>
					--><td align='center'><?php echo $v['email']?></td>
					<td align='center'><?php echo $v['user_money'];?></td>
<!--					<td align='center'><?php echo $v['fronze_money'];?></td>
					<td align='center'><?php echo $v['rank_points'];?></td>
					<td align='center'><?php echo $v['pay_points'];?></td>-->
					<td align="center"><?php if($v['disabled']==1){?><font color="red">√</font><?php }else{?><font color="blue">×</font><?php }?></td>
					<td align="center"><?php if($v['is_designer']==1){?><font color="red">√</font><?php }else{?><font color="blue">×</font><?php }?></td>
					<td align='center'><?php echo $v['reg_time']>0 ? date('Y-m-d H:i:s',$v['reg_time']) : null;?></td>
                                        <td align='center'><?php echo $languageList[$v['language_id']]['name'];?></td>
					<td align='left' style="padding-left:100px;"> 
					<a href="<?php echo U('user/user_edit', 'uid='.$v['id']);?>">修改</a>&nbsp;&nbsp;|&nbsp;&nbsp;
			<a href="<?php echo U('user/address_list', 'uid='.$v['id']);?>">收货地址</a>&nbsp;&nbsp;|&nbsp;&nbsp;
					<a href="<?php echo U('user/account_log_list', 'uid='.$v['id']);?>">账户明细</a>&nbsp;&nbsp;|&nbsp;&nbsp;
                                        <a href="<?php echo U('user/measure_info', 'uid='.$v['id']);?>">身形信息</a>&nbsp;&nbsp;|&nbsp;&nbsp;
<!--			&nbsp;&nbsp;|&nbsp;&nbsp;<a href="javascript:confirmurl('<?php echo U('user/user_delete', 'uid='.$v['id']);?>','确认要删除吗？')">删除</a>-->
                  <?php if($v['cart_num'] > 0):?><a href="<?php echo U('order/cart_product', '&search=搜索&searchtype=0&keyword='.$v['email'].'&usertype=1');?>" rel="nofollow" class="shopping-cart"><strong id="shoppingCartNumber"><?php echo $v['cart_num'];?></strong></a>&nbsp;&nbsp;|&nbsp;&nbsp;<?php endif;?>

					</td>
				</tr>
	<?php 
		endforeach;
		endif;
	?>
   </tbody>
    </table>
  <div id="pages"><?php echo $pageShow;?></div>
</div>
</div>
</body>
</html>